package com.teamwings.modules.file.fallback;

import com.teamwings.common.vo.Result;
import com.teamwings.modules.file.feign.FileServiceFeign;
import feign.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;

@Slf4j
public class FileFallback implements FileServiceFeign {
    private Throwable cause;
    public void setCause(final Throwable cause) {
        this.cause = cause;
    }
    @Override
    public Result<?> uploadFile(String userName, String savePath, String fileName, MultipartFile multipartFile) {
        log.error("文件上传失败 {}", this.cause);
        return null;
    }

    @Override
    public Result<?> moveFile(String strSource, String strTarget) {
        log.error("文件移动失败 {}", this.cause);
        return null;
    }

    @Override
    public Result<?> delFj(String userName, String savePath, String fileName) {
        log.error("文件删除失败 {}", this.cause);
        return null;
    }

    @Override
    public Response downLoadFile(String userName, String savePath) {
        log.error("文件下载失败 {}", this.cause);
        return null;
    }

    @Override
    public Response downLoadFiles(HttpServletResponse response, String paths) throws UnsupportedEncodingException {
        log.error("文件批量下载失败 {}", this.cause);
        return null;
    }

    @Override
    public Result<?> copyFileToFileSp(String userName, String sourceFile, String targetFile) {
        return null;
    }
}
